import torch
import torch.nn as nn
# import torch.nn.functional as F
from torch.autograd import Variable


class RNN(nn.Module):
    def __init__(self, n_cat, input_size, hidden_size, output_size):
        super(RNN, self).__init__()
        self.hidden_size = hidden_size
        self.output_size = output_size

        self.i2h = nn.Linear(n_cat + input_size + hidden_size, hidden_size)
        self.i2o = nn.Linear(n_cat + input_size + hidden_size, output_size)
        self.o2o = nn.Linear(output_size + hidden_size, output_size)
        self.dropout = nn.Dropout(0.1)
        self.softmax = nn.LogSoftmax()

    def forward(self, category_tensor, input_tensor, hidden):
        # print(category_tensor, input_tensor, hidden)
        input_combined = torch.cat((category_tensor, input_tensor, hidden), 1)
        # print(input_combined)
        hidden = self.i2h(input_combined)
        output = self.i2o(input_combined)
        # print(output)
        out_combined = torch.cat((hidden, output), 1)
        output = self.o2o(out_combined)
        output = self.dropout(output)
        output = self.softmax(output)
        return output, hidden

    def init_hidden(self):
        return Variable(torch.zeros(1, self.hidden_size))


class LSTM(nn.Module):
    def __init__(self):
        super(LSTM, self).__init__()

    def forward(self):
        pass
